<?php
/* @var $this SiteController */
/* @var $model ChangeForm */
/* @var $form CActiveForm  */
?>

<h1>Reportes</h1><br/><br/>

<?php if (Yii::app()->user->hasFlash('success')): ?>
  <div class="alert alert-success">
    <?php echo Yii::app()->user->getFlash('success'); ?>
  </div>
<?php endif ?>
<?php if (Yii::app()->user->hasFlash('error')): ?>
  <div class="alert">
    <?php echo Yii::app()->user->getFlash('error'); ?>
  </div>
<?php endif ?>

<div class="form-horizontal">
<?php $form=$this->beginWidget('CActiveForm', array(
	'id'=>'reportes-form',
	// Please note: When you enable ajax validation, make sure the corresponding
	// controller action is handling ajax validation correctly.
	// There is a call to performAjaxValidation() commented in generated controller code.
	// See class documentation of CActiveForm for details on this.
	'enableAjaxValidation'=>false,
)); ?>

  <div class="form-inline">
  <?php echo $form->labelEx($model,'tiporeporte', array('style'=>'width:15%','class'=>'control-label')); ?>
  <?php echo $form->labelEx($model,'fechainicial', array('style'=>'width:22%','class'=>'control-label')); ?>
  <?php echo $form->labelEx($model,'fechafinal', array('style'=>'width:20%','class'=>'control-label')); ?>
  <?php echo $form->labelEx($model,'bodegasatelite', array('style'=>'width:23%','class'=>'control-label')); ?>
  <?php //echo $form->labelEx($model,'concurso', array('style'=>'width:23%','class'=>'control-label')); ?>
 <br/><br/>
  </div>

  <div class="form-inline">
      <?php echo $form->dropDownList($model,'tiporeporte',array('Existenciabodega'=>'Existencias bodega', 'entradasbodegasatelite'=>'Entradas bodega satélite','Productosagotados'=>'Productos agotados','consumo'=>'Consumo por bodega', 'numeroconcurso'=>'Número de concurso','proveedor'=>'Proveedor'));?>
      <?php echo $form->error($model,'tiporeporte'); ?>
    
     <?php  $this->widget('zii.widgets.jui.CJuiDatePicker',array(
      'model'=>$model,
      'attribute'=>'fechainicial',
      'language' => 'es',
      'options'=>array(
          'autoSize'=>true,
          'dateFormat'=>'yy-mm-dd',
          'constrainInput'=>'false',
          'duration'=>'fast',
          'selectOtherMonths'=>true,
          'showAnim'=>'slide',
          'showButtonPanel'=>true,
          'showOtherMonths'=>true,
          'changeMonth' => 'true',
          'changeYear' => 'true',
          
      ),
      )); ?>
        
    <?php echo $form->error($model,'fechainicial'); ?>

 
  <?php  $this->widget('zii.widgets.jui.CJuiDatePicker',array(
      'model'=>$model,
      'attribute'=>'fechafinal',
      'language' => 'es',
      'options'=>array(
          
          'autoSize'=>true,
          'dateFormat'=>'yy-mm-dd',
          'constrainInput'=>'false',
          'duration'=>'fast',
          'selectOtherMonths'=>true,
          'showAnim'=>'slide',
          'showButtonPanel'=>true,
          'showOtherMonths'=>true,
          'changeMonth' => 'true',
          'changeYear' => 'true',
      ),
      )); ?>
        
    <?php echo $form->error($model,'fechafinal'); ?>


    <?php echo $form->dropDownList($model,'bodegasatelite',bodegaSatelite::tolist(),array('empty'=>'','style'=>'width:21%')); ?>

     <?php //echo $form->textField($model,'concurso'); ?>
    <?php //echo $form->error($model,'concurso'); ?>
  </div> 
   <br/>




 <div class="form-inline">
  <?php echo $form->labelEx($model,'concurso', array('style'=>'width:16%','class'=>'control-label')); ?>
  <?php echo $form->labelEx($model,'servicio', array('style'=>'width:19%','class'=>'control-label')); ?>
  <?php echo $form->labelEx($model,'proveedor', array('style'=>'width:22%','class'=>'control-label')); ?>
 <br/> <br/>
  </div>


   <div class="form-inline">


   <!-- concurso --> 

     <?php echo $form->textField($model,'concurso'); ?>
    <?php echo $form->error($model,'concurso'); ?>


    <!-- Servicio -->

      <?php
          $this->widget('ext.select2.ESelect2', array(
            'model' => $model,
            'attribute' => 'servicio',
            'data' => CHtml::listData(servicios::model()->findAll(), 'Se_idservicio_PK', 'Se_nombre'),
            'options' => array(
              'placeholder' => "",
              'allowClear'=>true,
              //'minimumInputLength'=>2,
            ),
            'htmlOptions'=>array(
              'style'=>'width:220px',
              //'multiple'=>'multiple',
            ),
          ));
          ?>


          <!-- Proveedor -->

      <?php
          $this->widget('ext.select2.ESelect2', array(
            'model' => $model,
            'attribute' => 'proveedor',
            'data' => CHtml::listData(proveedor::model()->findAll(), 'Pro_nombre', 'Pro_nombre'),
            'options' => array(
              'placeholder' => "",
              'allowClear'=>true,
              //'minimumInputLength'=>2,
            ),
            'htmlOptions'=>array(
              'style'=>'width:220px',
              //'multiple'=>'multiple',
            ),
          ));
          ?>


  </div>

  <br/>
  <br/>



  <div class="control-group">
 
      <?php echo CHtml::submitButton('Generar', array('class'=>'btn btn-primary')); ?>

  </div>

<?php $this->endWidget(); ?>
</div><!-- form -->


